package com.lyz.dataStructure.algorithm.huawei2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 19:08
 * @Description:
 **/

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/14 19:08
 *@Description:
 **/
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int N = sc.nextInt();
            String s = Integer.toBinaryString(N);
            System.out.println(s);
            if(s.length()==0){
                System.out.println(0);
            }
            int count = 0;
            int index = 0;
            for(int i =s.length()-1;i>=2;i--){
                if(s.charAt(i)=='1'&&s.charAt(i-1)=='0'&&s.charAt(i-2)=='1'){
                    count++;
                   index = Math.max(i,index);
                }else {
                    index = s.length()-1;
                }
            }
            if(count==0){
                index = s.length()-2;
            }
            System.out.println(count+" "+(index-s.length()+1));
        }
    }
}
